#ifndef _XX_YY_BMOCK_IN_MEM_FUNC_PTR
#define _XX_YY_BMOCK_IN_MEM_FUNC_PTR

#include "detail/bmock_in_arg_val.hpp"
#include "detail/bmock_mem_func_ptr_holder.hpp"

namespace bmock {
	template<typename T>
	struct in_mem_func_ptr : public in_arg_val
	{
		in_mem_func_ptr(const char *n,const std::string &val):
	in_arg_val(n,val){}
	protected:		
		virtual                   ~in_mem_func_ptr(){}

	};

	template<typename T, typename S>
	inline T pointer_reinterpret(S ptr) {
		union {
			T		tptr;
			S		sptr;
		} caster = {0};

		caster.sptr = ptr;
		return caster.tptr;
	}

	template<typename T>
	inline typename boost::enable_if<boost::is_member_function_pointer<T>,arg_val>::type 
		*make_in_mem_func_ptr(const char *const n,T ptr) {
			return new in_mem_func_ptr<T>(n,BMOCK_HEX_PREFIX+boost::lexical_cast<std::string>(pointer_reinterpret<void*>(ptr)));
	}
}

#define __BMOCK_USE_MEMBER_CLBK(ARG)\
	bmock::make_in_mem_func_ptr(BOOST_PP_STRINGIZE(ARG),ARG)

#endif
